#include "qavframe.h"

QAVFrame::QAVFrame()
{
    m_frame = av_frame_alloc();
}

QAVFrame::QAVFrame(AVFrame *frame)
{
    m_frame = frame;
}

QAVFrame::~QAVFrame()
{

}

AVFrame* QAVFrame::data()
{
    return m_frame;
}

AVFrame* QAVFrame::data() const
{
    return m_frame;
}

// true成功初始化buff， false初始化buff失败
bool QAVFrame::getBuffer(int align)
{
    return !av_frame_get_buffer(m_frame, align);
}

void QAVFrame::setWidth(int width)
{
    m_frame->width = width;
}

int QAVFrame::width()
{
    return m_frame->width;
}

void QAVFrame::setHeight(int height)
{
    m_frame->height = height;
}

int QAVFrame::height()
{
    return m_frame->height;
}

void QAVFrame::setFormat(int format)
{
    m_frame->format = format;
}

int QAVFrame::format()
{
    return m_frame->format;
}
